package com.mcptt.http.auth.process;

public class HttpAuthFailedException extends Exception
{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	public final static int Code_Suc = 0;
	public final static int ErrCode_Null = 1;
	public final static int ErrCode_Exception = 2;
	public final static int ErrCode_Result_Err = 3;
	public final static int ErrCode_Passward = 8;
	public final static int ErrCode_License = 9;

	private String name = "";
	private int code = Code_Suc;
	private String errStr = "";

	public HttpAuthFailedException(String name)
	{
		super();
		this.name = name;
	}
	public HttpAuthFailedException(String name, String errStr)
	{
		super();
		this.name = name;
		this.errStr = errStr;
	}
	public HttpAuthFailedException(String name,int code, String errStr)
	{
		super();
		this.name = name;
		this.code = code;
		this.errStr = errStr;
	}
	public int getCode() {
		return code;
	}
	public String toString()
	{
		StringBuffer strBuf = new StringBuffer(this.getClass().getSimpleName());
		strBuf.append(":").append(name);
		if(errStr != null
				&& errStr.length() >0)
		{
			strBuf.append("(");
			strBuf.append(errStr).append(")");
		}
		return strBuf.toString();
	}
}
